Multiples of 3 and 5

Find the sum of all the multiples of 3 or 5 below 1000.



Plan:

In order to figure out the sum, we need to add up all of the numbers below 1000 that are multiples of either 3 or 5.



Pseudocode:

  1. set the intial number to 0
  2. intialize the sum to 0
  3. intialize a counter to 0
  4. create a loop that goes to 1000
  5. add numbers to the sum that are divisable by either 3 or 5
  6. print out the sum


Solution:





Link to home page